package guanqu.beans;


import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;


import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @author cai
 * @date   2015-10-30
 * 渠道工程基本信息表
 * 包括渠道和闸门的一对多关系
 * 包括主干渠道和干渠的一对多的自连接关系
 */

@Entity
@Table(name="t_IrrBTCanalDetail")
public class IrrBTCanalDetail {
	private String canalCode;				//渠系code
	private String canalName;				//渠系名
	private Character	canalG;				//渠道级别 :主干渠和干渠
	private BigDecimal canalDesQ;			//渠道设计流量
	private BigDecimal leakR;				//渗漏系数
	private	BigDecimal canalLen;			//渠道长度
	private BigDecimal lineLen;				//衬砌长度
	private String 	engManCd;				//管理单位代码
	private String uperCanalCd;				//上一级渠系code
	private Calendar timeSign;				//时间戳
	private String remark;					//备注
	
	private String stadiaCode; // 测站编码
	private String canalDesWL; // 渠道的设计水位
	
//	private List<IrrBAWaterGate> irrBAWaterGates; 				//渠道对应的闸门
//	
//	private IrrBTCanalDetail mainIrrBTCanalDetail;				//主干渠
//	private List<IrrBTCanalDetail> childIrrBTCanalDetails;		//主干渠对应的干渠
	@Id
	public String getCanalCode() {
		return canalCode;
	}
	public void setCanalCode(String canalCode) {
		this.canalCode = canalCode;
	}
	public String getCanalName() {
		return canalName;
	}
	public void setCanalName(String canalName) {
		this.canalName = canalName;
	}
	public Character getCanalG() {
		return canalG;
	}
	public void setCanalG(Character canalG) {
		this.canalG = canalG;
	}
	public BigDecimal getCanalDesQ() {
		return canalDesQ;
	}
	public void setCanalDesQ(BigDecimal canalDesQ) {
		this.canalDesQ = canalDesQ;
	}
	public BigDecimal getLeakR() {
		return leakR;
	}
	public void setLeakR(BigDecimal leakR) {
		this.leakR = leakR;
	}
	public BigDecimal getCanalLen() {
		return canalLen;
	}
	public void setCanalLen(BigDecimal canalLen) {
		this.canalLen = canalLen;
	}
	public BigDecimal getLineLen() {
		return lineLen;
	}
	public void setLineLen(BigDecimal lineLen) {
		this.lineLen = lineLen;
	}
	public String getEngManCd() {
		return engManCd;
	}
	public void setEngManCd(String engManCd) {
		this.engManCd = engManCd;
	}
	public String getUperCanalCd() {
		return uperCanalCd;
	}
	public void setUperCanalCd(String uperCanalCd) {
		this.uperCanalCd = uperCanalCd;
	}
	public Calendar getTimeSign() {
		return timeSign;
	}
	public void setTimeSign(Calendar timeSign) {
		this.timeSign = timeSign;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	
	public String getCanalDesWL() {
		return canalDesWL;
	}
	public void setCanalDesWL(String canalDesWL) {
		this.canalDesWL = canalDesWL;
	}
	@Transient
	public String getStadiaCode() {
		return stadiaCode;
	}
	public void setStadiaCode(String stadiaCode) {
		this.stadiaCode = stadiaCode;
	}
	
//	//渠道和闸门一对多关系
//	@OneToMany(cascade=CascadeType.ALL,mappedBy="irrBTCanalDetail" ,fetch =FetchType.EAGER)
//	public List<IrrBAWaterGate> getIrrBAWaterGates() {
//		return irrBAWaterGates;
//	}
//	public void setIrrBAWaterGates(List<IrrBAWaterGate> irrBAWaterGates) {
//		this.irrBAWaterGates = irrBAWaterGates;
//	}
//	
//	//干渠和主干渠道多对一
//	@ManyToOne(fetch=FetchType.EAGER)	
//	@JoinColumn(name="uperCanalCd",insertable=false,updatable=false)
//	public IrrBTCanalDetail getMainIrrBTCanalDetail() {
//		return mainIrrBTCanalDetail;
//	}
//	public void setMainIrrBTCanalDetail(IrrBTCanalDetail mainIrrBTCanalDetail) {
//		this.mainIrrBTCanalDetail = mainIrrBTCanalDetail;
//	}
//	
//	@OneToMany(targetEntity = IrrBTCanalDetail.class, cascade=CascadeType.ALL,mappedBy="mainIrrBTCanalDetail",fetch=FetchType.EAGER)	
//	public List<IrrBTCanalDetail> getChildIrrBTCanalDetails() {
//		return childIrrBTCanalDetails;
//	}
//	public void setChildIrrBTCanalDetails(
//			List<IrrBTCanalDetail> childIrrBTCanalDetails) {
//		this.childIrrBTCanalDetails = childIrrBTCanalDetails;
//	}
	
	

}
